classdef SimpleMutationCrosser
    %UNTITLED7 Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
        mutation_density %= 0.02
    end
    
    methods
        
        function mut = SimpleMutationCrosser(mutation_density)
            if nargin < 1
                mut.mutation_density = 0.02;
            else
                mut.mutation_density = mutation_density;
            end
            
        end
        
        function children = execute(self, obj, parents)
            
            children = SimpleCrosser().execute(obj, parents);
            %self.mutation_density = 0.02;
            children(1).connections = xor(children(1).connections, random_connections( obj.stops.number, self.mutation_density ));
            children(2).connections = xor(children(2).connections, random_connections( obj.stops.number, self.mutation_density ));
            
        end
        
    end
    
end

